home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
shared.cst
/
00424_Script_Patent Object Script
< prev
next >
Wrap
Text File
|
1997-07-24
|
9KB
|
258 lines
--o Patent object
--instantiated as gPatentObj
property pZoomedIn, pDisplayingPatents
property pBackGSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum, pPatentPictSpriteNum
property pLeftBarSpriteNum
property pPatentLocH, pPatentLocV
property pTextLineCounter, pCurrentTextDB, pTextFieldCastNameList
property pBackGrndBaseCastList
property pFirstCastNumList, pLastCastNumList
--BELL SPECIFIC PROPERTIES
property pBellFirstCast, pBellLastCast, pBellBackGrndBaseCastName, pBellTextFieldCastName
--WATT SPECIFIC PROPERTIES
property pWattFirstCast, pWattLastCast, pWattBackGrndBaseCastName, pWattTextFieldCastName
--EDISON SPECIFIC PROPERTIES
property pEdisonFirstCast, pEdisonLastCast
property pPageSnd,pDrawerSndList
property pmaxLocv
property pMinLocv
global gInventorIndexNum, gScoreEventObj, gUtilityObj, gInterfaceMgrObj
global gActorListMgrObj
------------------------------------------------------------------<<ò>>
on mInit me
set pTextLineCounter = 0
set pFirstCastNumList = [0,0,0]
set pLastCastNumList = [0,0,0]
set pTextFieldCastNameList = [0,0,0]
set pBackGrndBaseCastList = [0,0,0]
set pPatentLocH = 240
set pPatentLocV = 260
--BELL
set pBellFirstCast = "BPATN1A.PIC"
set pBellLastCast = "BPATN12A.PIC"
set pBellBackGrndBaseCastName = "BDESK2.PIC"
set pBellTextFieldCastName = "Bell Patent Text"
--WATT
set pWattFirstCast = "WPATNT1A.PIC"
set pWattLastCast = "WPATNT11A.PIC"
set pWattBackGrndBaseCastName = "WDESKBK1.PIC"
set pWattTextFieldCastName = "Watt Patent Text"
set pBackGSpriteNum = 2
set pPatentPictSpriteNum = 9
set pDogEarSpriteNum = 10
set pDrawerSpriteNum = 6
set pLeftBarSpriteNum = 21 --RightBarSpriteNum is this + 1
set pDrawerSndList = [0, "BDRAWER.AIF", "BDRAWER.AIF"]
set pPageSnd = 1392
return me
end mInit
------------------------------------------------------------------<<ò>>
on mActivate me
puppetSprite pBackGSpriteNum, true
puppetSprite pPatentPictSpriteNum, true
set snd = getAt(pDrawerSndList, gInventorIndexNum)
puppetsound 2, snd
updatestage
set pDisplayingPatents = false
set pZoomedIn = false
set pCurrentTextDB = " "
set TempPropList = [:]
addProp (TempPropList, value(pDrawerSpriteNum), #ZoomIN)
mSetCursors(gUtilityObj, TempPropList)
if gInventorIndexNum = 1 then
--EDISON
set pmaxLocv = 438
set pMinLocv = 82
else if gInventorIndexNum = 3 then
--WATT
setAt(pFirstCastNumList, 3, (the number of cast pWattFirstCast))
setAt(pLastCastNumList, 3, (the number of cast pWattLastCast))
setAt(pTextFieldCastNameList, 3, (the number of cast pWattTextFieldCastName))
setAt(pBackGrndBaseCastList, 3, (the number of cast pWattBackGrndBaseCastName))
set pmaxLocv = 377
set pMinLocv = 142
else if gInventorIndexNum = 2 then
--BELL
setAt(pFirstCastNumList, 2, (the number of cast pBellFirstCast))
setAt(pLastCastNumList, 2, (the number of cast pBellLastCast))
setAt(pTextFieldCastNameList, 2, (the number of cast pBellTextFieldCastName))
setAt(pBackGrndBaseCastList, 2, (the number of cast pBellBackGrndBaseCastName))
set pmaxLocv = 438
set pMinLocv = 82
end if
mSetToolBtns (gInterfaceMgrObj, #PATENTS, me)
end mActivate
------------------------------------------------------------------<<ò>>
on mClose me
set the locv of sprite pPatentPictSpriteNum = -1000
puppetSprite pBackGSpriteNum, false
puppetSprite pPatentPictSpriteNum, false
updatestage
mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
end mClose
------------------------------------------------------------------<<ò>>
on mPatentClickEvent me
set SpriteClicked = the clickOn
if SpriteClicked = pDogEarSpriteNum then
if pDisplayingPatents and (not pZoomedIn) then
mDogEarClick(me)
end if
else if (SpriteClicked = pDrawerSpriteNum) and (not pDisplayingPatents) then
mDisplayPatents(me)
else if (SpriteClicked = pLeftBarSpriteNum) or (Spriteclicked = pLeftBarSpriteNum + 1) then
if pZoomedIn then
mSwitchZoomLevel(me)
else if not pZoomedIn then
mInitiatePullOut (me)
end if
end if
end mPatentClickEvent
------------------------------------------------------------------<<ò>>
on mDisplayPatents me
set pTextLineCounter = 1
set pCurrentTextDB = getAt(pTextFieldCastNameList, gInventorIndexNum)
mUpdateText(me)
set tempPropList = [:]
addProp (tempPropList, value(pPatentPictSpriteNum), #ZoomIn)
addProp (tempPropList, value(pDogEarSpriteNum), #FINGER)
mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
mSetCursors(gUtilityObj, tempPropList)
set pDisplayingPatents = true
set the castNum of sprite pPatentPictSpriteNum = getAt(pFirstCastNumList, gInventorIndexNum)
set the locH of sprite pPatentPictSpriteNum = pPatentLocH
set the locV of sprite pPatentPictSpriteNum = pPatentLocV
set the castNum of sprite pBackGSpriteNum = (getAt(pBackGrndBaseCastList, gInventorIndexNum))
updateStage
set pZoomedIn = false
end mDisplayPatents
------------------------------------------------------------------<<ò>>
on mSwitchZoomLevel me
if pZoomedIn then
set the castNum of sprite pPatentPictSpriteNum = (the castNum of sprite pPatentPictSpriteNum) - 1
set the locV of sprite pPatentPictSpriteNum = pPatentLocV
set tempPropList = [:]
addProp (tempPropList, value(pPatentPictSpriteNum), #ZoomIn)
addProp (tempPropList, value(pDogEarSpriteNum), #FINGER)
mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
mSetCursors(gUtilityObj, tempPropList)
else if not pZoomedIn then
set the castNum of sprite pPatentPictSpriteNum = (the castNum of sprite pPatentPictSpriteNum) + 1
set tempPropList = [:]
addProp (tempPropList, value(pPatentPictSpriteNum), #Operate)
mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
mSetCursors(gUtilityObj, tempPropList)
end if
updateStage
set pZoomedIn = not pZoomedIn
end mSwitchZoomLevel
------------------------------------------------------------------<<ò>>
on mDogEarClick me
sound stop 2
updatestage
puppetsound 2, pPageSnd
if the castNum of sprite pPatentPictSpriteNum = getAt(pLastCastNumList, gInventorIndexNum) then
set the castNum of sprite pPatentPictSpriteNum = getAt(pFirstCastNumList, gInventorIndexNum)
set pTextLineCounter = 1
else
set the castNum of sprite pPatentPictSpriteNum = (the castNum of sprite pPatentPictSpriteNum) + 2
set pTextLineCounter = pTextLineCounter + 6
end if
mUpdateText(me)
updateStage
end mDogEarClick
------------------------------------------------------------------<<ò>>
on mInitiatePullOut me
mClose(me)
mPullOut(gScoreEventObj)
end mInitiatePullOut
------------------------------------------------------------------<<ò>>
on mDragBlownUpPatent me
set InitialMouseV = the mouseV
set InitialPatentLocV = the locV of sprite pPatentPictSpriteNum
mSuspendActorlist (gActorListMgrObj )
repeat while the mouseDown
set mouseDelta = the mouseV - InitialMouseV
set NewPatentLocV = InitialPatentLocV + mouseDelta
if NewPatentLocV > pmaxLocv then set NewPatentLocV = pmaxLocv
if NewPatentLocV < pMinLocv then set NewPatentLocV = pMinLocv
set the locV of sprite pPatentPictSpriteNum = NewPatentLocV
updateStage
end repeat
mResumeActorlist ( gActorListMgrObj )
end mDragBlownUpPatent
------------------------------------------------------------------<<ò>>
on mUpdateText me
set labelString = line pTextLineCounter to (pTextLineCounter + 2) of field pCurrentTextDB
set BodyString = line (pTextLineCounter + 3) to (pTextLineCounter + 5) of field pCurrentTextDB
mDisplaySecondaryText(gUtilityObj, LabelString, BodyString)
end mUpdateText
------------------------------------------------------------------<<ò>>
on mPatentDownClick me
if pDisplayingPatents and pZoomedIn then
mDragBlownUpPatent(me)
dontPassEvent
end if
end mPatentDownClick
------------------------------------------------------------------<<ò>>
on mPatentUpClick me
if pDisplayingPatents and not pZoomedIn then mSwitchZoomLevel(me)
end mPatentUpClick
------------------------------------------------------------------<<ò>>
on mZoom me, whatselection
if (whatselection = 1) and ( pZoomedIn) then
mSwitchZoomLevel me
else if (whatselection = 2) and not pZoomedIn then
mSwitchZoomLevel me
end if
end mZoom
------------------------------------------------------------------<<ò>>